home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
mike40c.arc
/
PUTMSG.C
< prev
next >
Wrap
Text File
|
1986-10-24
|
2KB
|
49 lines
/**********************************************************
* title: put_screen.c *
* put attribute, char array to screen buffer *
**********************************************************/
put_screen(buf, attrib, rowstart, colstart, pag)
char *buf; /* text buffer(aranged in col-row order */
unsigned int attrib; /* attribute to be assigned to text */
int rowstart; /* row position within screen (0,...) */
int colstart; /* column position within screen */
int pag; /* Video text page */
{
char tempbuf[161]; /* combined data-attribute buffer for one line */
char *mbufptr, *interleave(); /* pointer into source buf */
int base, index; /* indexs into screen buffer */
int i; /* row counter */
int rowsize = 1, colsize;
colsize = strlen(buf);
mbufptr = buf;
base = (rowstart * 80) + colstart;
for (i = 0; i < rowsize; i++) {
mbufptr = interleave(mbufptr, attrib, tempbuf, colsize);
index = base + (i * 80);
putsc(tempbuf, index, colsize, pag); /* no-snow buff,start,length */
}
}
/**********************************************************
* title: interlv.c *
* interleaves character with attribute into screen buff *
* returns pointer into buffer where we left off *
**********************************************************/
char *interleave(aa, b, c, count) /* returns new pointer into source buffer */
char *aa; /* pointer into source buffer */
unsigned int b; /* attribute to interleave */
char *c; /* pointer to destination buffer */
int count; /* number of chars to process */
{
register int i; /* group counter */
for (i = 0; i < count; ++i) {
*c++ = *aa++; /* place data */
*c++ = b; /* place attrib */
}
return aa;
}